<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 商品品牌 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Goodsbrand.name", default="fa_goodsbrand"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\Goodsbrand.poolName"))
 * @DDL(sql="CREATE TABLE `fa_goodsbrand` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL DEFAULT '',
  `image` varchar(100) DEFAULT '' COMMENT '品牌图',
  `goodscate_id` int(10) NOT NULL COMMENT '商品分类',
  `weigh` int(10) DEFAULT '0' COMMENT '权重',
  `description` varchar(255) DEFAULT '' COMMENT '描述',
  `status` enum('up','hidden','down') NOT NULL DEFAULT 'up' COMMENT '状态:up=上架,hidden=隐藏,down=下架',
  `goodsbrand_ratio` decimal(5,2) DEFAULT '0.00' COMMENT '品牌比例',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(16) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `weigh_id` (`weigh`,`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品品牌'", decode="")
 *
 * @property int|null $id 
 * @property string|null $name 
 * @property string|null $image 品牌图
 * @property int|null $goodscateId 商品分类
 * @property int|null $weigh 权重
 * @property string|null $description 描述
 * @property string|null $status 状态:up=上架,hidden=隐藏,down=下架
 * @property string|float|int|null $goodsbrandRatio 品牌比例
 * @property int|null $createtime 创建时间
 * @property int|null $updatetime 更新时间
 * @property int|null $deletetime 
 */
abstract class GoodsbrandBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * name.
     * @Column(name="name", type="varchar", length=30, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $name = '';

    /**
     * 获取 name.
     *
     * @return string|null
     */
    public function getName(): ?string
    {
        return $this->name;
    }

    /**
     * 赋值 name.
     * @param string|null $name name
     * @return static
     */
    public function setName($name)
    {
        $this->name = null === $name ? null : (string)$name;
        return $this;
    }

    /**
     * 品牌图.
     * image
     * @Column(name="image", type="varchar", length=100, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $image = '';

    /**
     * 获取 image - 品牌图.
     *
     * @return string|null
     */
    public function getImage(): ?string
    {
        return $this->image;
    }

    /**
     * 赋值 image - 品牌图.
     * @param string|null $image image
     * @return static
     */
    public function setImage($image)
    {
        $this->image = null === $image ? null : (string)$image;
        return $this;
    }

    /**
     * 商品分类.
     * goodscate_id
     * @Column(name="goodscate_id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $goodscateId = NULL;

    /**
     * 获取 goodscateId - 商品分类.
     *
     * @return int|null
     */
    public function getGoodscateId(): ?int
    {
        return $this->goodscateId;
    }

    /**
     * 赋值 goodscateId - 商品分类.
     * @param int|null $goodscateId goodscate_id
     * @return static
     */
    public function setGoodscateId($goodscateId)
    {
        $this->goodscateId = null === $goodscateId ? null : (int)$goodscateId;
        return $this;
    }

    /**
     * 权重.
     * weigh
     * @Column(name="weigh", type="int", length=10, accuracy=0, nullable=true, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $weigh = 0;

    /**
     * 获取 weigh - 权重.
     *
     * @return int|null
     */
    public function getWeigh(): ?int
    {
        return $this->weigh;
    }

    /**
     * 赋值 weigh - 权重.
     * @param int|null $weigh weigh
     * @return static
     */
    public function setWeigh($weigh)
    {
        $this->weigh = null === $weigh ? null : (int)$weigh;
        return $this;
    }

    /**
     * 描述.
     * description
     * @Column(name="description", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $description = '';

    /**
     * 获取 description - 描述.
     *
     * @return string|null
     */
    public function getDescription(): ?string
    {
        return $this->description;
    }

    /**
     * 赋值 description - 描述.
     * @param string|null $description description
     * @return static
     */
    public function setDescription($description)
    {
        $this->description = null === $description ? null : (string)$description;
        return $this;
    }

    /**
     * 状态:up=上架,hidden=隐藏,down=下架.
     * status
     * @Column(name="status", type="enum", length=0, accuracy=0, nullable=false, default="up", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $status = 'up';

    /**
     * 获取 status - 状态:up=上架,hidden=隐藏,down=下架.
     *
     * @return string|null
     */
    public function getStatus(): ?string
    {
        return $this->status;
    }

    /**
     * 赋值 status - 状态:up=上架,hidden=隐藏,down=下架.
     * @param string|null $status status
     * @return static
     */
    public function setStatus($status)
    {
        $this->status = null === $status ? null : (string)$status;
        return $this;
    }

    /**
     * 品牌比例.
     * goodsbrand_ratio
     * @Column(name="goodsbrand_ratio", type="decimal", length=5, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $goodsbrandRatio = NULL;

    /**
     * 获取 goodsbrandRatio - 品牌比例.
     *
     * @return string|float|int|null
     */
    public function getGoodsbrandRatio()
    {
        return $this->goodsbrandRatio;
    }

    /**
     * 赋值 goodsbrandRatio - 品牌比例.
     * @param string|float|int|null $goodsbrandRatio goodsbrand_ratio
     * @return static
     */
    public function setGoodsbrandRatio($goodsbrandRatio)
    {
        $this->goodsbrandRatio = null === $goodsbrandRatio ? null : $goodsbrandRatio;
        return $this;
    }

    /**
     * 创建时间.
     * createtime
     * @Column(name="createtime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $createtime = NULL;

    /**
     * 获取 createtime - 创建时间.
     *
     * @return int|null
     */
    public function getCreatetime(): ?int
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建时间.
     * @param int|null $createtime createtime
     * @return static
     */
    public function setCreatetime($createtime)
    {
        $this->createtime = null === $createtime ? null : (int)$createtime;
        return $this;
    }

    /**
     * 更新时间.
     * updatetime
     * @Column(name="updatetime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $updatetime = NULL;

    /**
     * 获取 updatetime - 更新时间.
     *
     * @return int|null
     */
    public function getUpdatetime(): ?int
    {
        return $this->updatetime;
    }

    /**
     * 赋值 updatetime - 更新时间.
     * @param int|null $updatetime updatetime
     * @return static
     */
    public function setUpdatetime($updatetime)
    {
        $this->updatetime = null === $updatetime ? null : (int)$updatetime;
        return $this;
    }

    /**
     * deletetime.
     * @Column(name="deletetime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $deletetime = NULL;

    /**
     * 获取 deletetime.
     *
     * @return int|null
     */
    public function getDeletetime(): ?int
    {
        return $this->deletetime;
    }

    /**
     * 赋值 deletetime.
     * @param int|null $deletetime deletetime
     * @return static
     */
    public function setDeletetime($deletetime)
    {
        $this->deletetime = null === $deletetime ? null : (int)$deletetime;
        return $this;
    }

}
